package org.nokatag.tagjava;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.TagSupport;

public class NokaTag extends TagSupport{

	private static final long serialVersionUID = 5182893097912671269L;
	protected static final String path = "";
	
	protected boolean isend(HttpServletRequest request,String key){
		NokaTagInterface nt = new NokaTagImp();
		return nt.isend(request, key);
	}
	
	protected String potjs(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.potjs(request);
	}
	protected String nhtmlboxjs(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.nhtmlboxjs(request);
	}
	
	
	protected String nkUtiljs(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.nkUtiljs(request);
	}
	
	protected String dbjs(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.dbjs(request);
	}
	
	protected String treejs(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.treejs(request);
	}
	protected String treeTranjs(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.treeTranjs(request);
	}
	
	protected String selectCss(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.selectCss(request);
	}
	
	
	
	protected String accordionCss(Integer styleid,HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.accordionCss(styleid,request);
	}
	
	
	protected String selectjs(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.selectjs(request);
	}
	
	protected String selectinputjs(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.selectinputjs(request);
	}
	
	
	
	protected String selectMultijs(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.selectMultijs(request);
	}
	
	protected String selectCustomjs(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.selectCustomjs(request);
	}
	
	protected String selectDoublejs(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.selectDoublejs(request);
	}
	
	protected String selectButtonjs(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.selectButtonjs(request);
	}
	
	
	protected String inputTextJS(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.inputTextJS(request);
	}
	
	protected String ajaxinputTextJS(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.ajaxinputTextJS(request);
	}
	protected String multInputTextJS(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.multInputTextJS(request);
	}
	protected String nkrchecksJS(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.nkrchecksJS(request);
	}
	
	protected String nkdateJS(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.nkdateJS(request);
	}
	
	protected String nkBoxJsAndCss(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.nkBoxJsAndCss(request);
	}
	
	protected String nktextareaJS(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.nktextareaJS(request);
	}
	
	protected String potuploadjs(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.potuploadjs(request);
	}
	
	protected String potimageuploadjs(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.potimageuploadjs(request);
	}
	
	
	protected String basepath(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.basepath(request);
	}
	protected String ColorSelectJS(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.ColorSelectJS(request);
	}
	protected String htmlEdit(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.htmlEdit(request);
	}
	
	protected String TableJS(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.TableJS(request);
	}
	protected  String DbgridCSS(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.DbgridCSS(request);
	}
	protected String formLayoutCss(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.formLayoutCss(request);
	}
	protected String AccordionJS(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.AccordionJS(request);
	}
	protected String hiddensJs(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.hiddensJs(request);
	}
	protected String hiddenJs(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.hiddenJs(request);
	}
	protected String StatChartJS(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.StatChartJS(request);
	}
	protected String SocketJS(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.SocketJS(request);
	}
	protected String InfoBoxJS(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.InfoBoxJS(request);
	}
	
	protected String codeBverJS(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.codeBverJS(request);
	}
	
	protected String MousRigthMenuJS(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.MousRigthMenuJS(request);
	}
	
	protected String topToolsJS(HttpServletRequest request,String style){
		NokaTagInterface nt = new NokaTagImp();
		return nt.topToolsJS(request,style);
	}
	
	protected String leftMenuJS(HttpServletRequest request,String style){
		NokaTagInterface nt = new NokaTagImp();
		return nt.leftMenuJS(request,style);
	}
	protected String ntabMenuJS(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.ntabMenuJS(request);
	}
	protected String ntabJS(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.ntabJS(request);
	}
	protected String nstar(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.nstar(request);
	}
	
	protected String nswitch(HttpServletRequest request){
		NokaTagInterface nt = new NokaTagImp();
		return nt.nswitch(request);
	}
	
	protected String LenFormat(String Len){
		NokaTagInterface nt = new NokaTagImp();
		return nt.LenFormat(Len);
	}
	protected String LenNumber(String Len){
		NokaTagInterface nt = new NokaTagImp();
		return nt.LenNumber(Len);
	}
	protected Boolean Equery(String cx,String ex){
		NokaTagInterface nt = new NokaTagImp();
		return nt.Equery(cx, ex);
	}
	protected FormHtml getTagFormHtml(Tag tag){
		NokaTagInterface nt = new NokaTagImp();
		return nt.getTagFormHtml(tag);
	}
	protected String shortcutkey(String keys, String buttonid,String jsfunction){
		NokaTagInterface nt = new NokaTagImp();
		return nt.shortcutkey(keys,buttonid,jsfunction);
	}
	
	protected void  FormHtmlInsertid(String id,String name,String value){
		FormHtml formHtml = null;
		if(this.getParent()  instanceof FormHtml){
			formHtml= (FormHtml)this.getParent();
		}
		if(this.getParent()  instanceof FormRow){
			FormRow formRow =  (FormRow)this.getParent();
			if(formRow.getParent() instanceof FormHtml){
				formHtml = (FormHtml)formRow.getParent();
			}
		}
		if(this.getParent()  instanceof FormCell){
			FormCell formCell = (FormCell)this.getParent();//单元格
			if(formCell.getParent()  instanceof FormRow){//行
				FormRow formRow =  (FormRow)formCell.getParent();
				if(formRow.getParent() instanceof FormHtml){//表单
					formHtml = (FormHtml)formRow.getParent();
				}
			}
		}
		if(null!=formHtml){
			formHtml.insertidx(id,name,value);
		}
	}
	
	protected String JSFunction(String jsfunction){//jsfunction ssss    || ssss(self,'sff')
		if(null==jsfunction){
			return "return true;";
		}
		if(jsfunction.indexOf(")")!=-1){
			return "return "+jsfunction;
		}
		return "return "+jsfunction+"(self);";
	}
	protected String NJSFunction(String jsfunction){//jsfunction ssss    || ssss(self,'sff')
		if(null==jsfunction){
			return " ";
		}
		if(jsfunction.indexOf(")")!=-1){
			return jsfunction;
		}
		return jsfunction+"(self);";
	}
}
